﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.DynamicProxy;

namespace Hyt.Core.Interceptors
{
    public class AuthInterceptorAttribute : InterceptorAttribute
    {
        public override IInterceptor GetInterceptor(IUnitOfWork unitofwork)
        {
            var interceptor = unitofwork.Get<AuthInterceptor>();
            interceptor.Principal = unitofwork.GetCurrentPrincipal();
            return interceptor;
        }
    }
}
